package com.example.Controller;


import com.example.Service.FengShuiService;
import com.example.staticlei.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.regex.Pattern;

@RequestMapping("/phoneNumber")
@RestController
@Slf4j
@CrossOrigin
public class FengShuiController {
    @Autowired
    private FengShuiService fengShuiService;
    @GetMapping("/number")
    public Result ReturnMessage(@RequestParam String number) {
        int id = fengShuiService.getMessage(number).getId();
        if (id == 0){
            return Result.fail(fengShuiService.getMessage(number));
        }else {
            return Result.success(fengShuiService.getMessage(number));
        }
    }
}
